﻿<%@ page language="java" contentType="text/html;  charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="k" uri="http://www.xiaoke.com"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>扣款查询首页</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<script type="text/javascript" src="${ctx}/resources/jquery/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/dataTable/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="${ctx}/resources/bootstrap/css/bootstrap.min.css" type="text/css">
<style type="text/css">
html,body{margin:0px;padding:0px;}
.table{margin:0px;}
.table th, .table td{padding:7px;white-space:nowrap;}
.pager{text-align:left;}
.pager .next a{float:none;}
.pagination{margin:4px;}
@import "${ctx}/resources/dataTable/css/datatable.css";
</style>
<script>
function refresh(){
	location.href = location.href;
}
$(function(){
	$(".table").dataTable({
		"bPaginate": false, //翻页功能
		"bLengthChange": false, //改变每页显示数据数量
		"bFilter": false, //过滤功能
		"bSort": true, //排序功能
		"bInfo": false,//页脚信息
		"bAutoWidth": true//自动宽度
		// "sPaginationType": "full_numbers"
	});
	// 返回
	$(".btn_back").click(function(){
		parent.hideList();
	});
	// 添加
	$(".btn_add").click(function(){
		window.showModalDialog("${ctx}/qx/module/toAdd");
	});
	$(".table .link a").click(function(e){
		e.preventDefault();
		if(e.target.className != "del"){
			var href = $(this).attr("href");
			window.showModalDialog(href);
		}else{
			if(confirm("确定删除吗？")){
				var href = $(this).attr("href");
				$.getJSON(href,function(res){
					if(res == "1"){
						alert("删除成功！");
						refresh();
					}else{
						alert("删除失败！");
					}
				});
			}
		}
	});
});
</script>
</head>
<body>
<table class="table">
	<thead>
		<tr>
			<td colspan="12">
				<div align="center"><h2>纳税人信息列表</h2></div>
			</td>
		</tr>
		<tr>
			<td align="center" colspan="12">
				<span>总记录数：${page.totalResult}条，当前第${page.curPage}页</span>
				<k:page style="display:inline-block;float:right;" showNumLink="false" showBeginEnd="false" />
				<button class="btn btn-success btn_back" style="margin:4px;width:70px;height:36px;float:right;">返回</button>
				<button class="btn btn-success btn_add" style="margin:4px;width:70px;height:36px;float:right;">添加</button>
			</td>
		</tr>
		<tr>
			<th width="150">节点ID</th>
			<th width="100">名称</th>
			<th>URL地址</th>
			<th width="100">父节点ID</th>
			<th width="100">排序</th>
			<th width="100">是否叶子节点</th>
			<th width="100">是否模块</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${moduleList}" var="module" varStatus="i">
			<tr>
				<td>${module.NODE}</td>
				<td>${module.NAME}</td>
				<td>${module.URL}</td>
				<td>${module.PID}</td>
				<td>${module.SORT}</td>
				<td>${module.ISLEAF}</td>
				<td>${module.ISMODULE}</td>
				<td width="100" class="link">
					<a class="form" href="${ctx}/qx/module/form?id=${module.ID}">查看</a>
					<a class="upd" href="${ctx}/qx/module/toUpd?id=${module.ID}">修改</a>
					<a class="del" href="${ctx}/qx/module/del?id=${module.ID}">删除</a>
				</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="12"><k:page /></td>
		</tr>
	</tfoot>
</table>
</body>
<html>